#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main() {
    int count = 0;
    char a = 0;
    while ((a = getchar()) != '\n')
    {
        if (a != ' ')
            count++;
    }
    printf("%d", count);
    return 0;
}